#include "mycombox.h"
#include <QPixmap>

MyCombox::MyCombox(QStringList list, QWidget *parent)
    : QComboBox(parent)
{
    setStyleSheet("background:transparent;");//#transparent
    setFocusPolicy(Qt::NoFocus);
    setStyleSheet("QComboBox {border: 1px solid gray;padding: 1px 15px 1px 5px; font: 15px;color: #000000;background: transparent;}"
                  "QComboBox QAbstractItemView {outline: 0px solid gray;border: 1px solid gray; font:15px;color:#000000;background:white; selection-background-color: lightblue;}");
    addItems(list);

//    QComboBox QAbstractItemView {
//        border: 1px solid yellow;   /* 整个下拉窗体的边框 */
//        color: green;
//        background-color: red;   /* 整个下拉窗体的背景色 */
//        selection-background-color: lightgreen;   /* 整个下拉窗体被选中项的背景色 */
//    }
//    QComboBox {
//        border: 1px solid gray;   /* 边框 */
//        border-radius: 3px;   /* 圆角 */
//        padding: 1px 18px 1px 3px;   /* 字体填衬 */
//        color: #000;
//        font: normal normal 15px "Microsoft YaHei";
//        background: transparent;
//    }

//    QPixmap pixmap(1, 30);
//    pixmap.fill(Qt::transparent);
//    QIcon icon(pixmap);
//    setIconSize(QSize(1, 30));

//   for (int i = 0; i < list.count(); i++)
//   {
//       addItem(icon, list.at(i));//icon,
//   }
}
